home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
faq-s.zip
/
FAQUE.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-04-13
|
12KB
|
433 lines
{$M 16384,5000,5000}
Uses Dos,Crt,configrt,gentypes,userret;
Var
Infile :File of Userrec;
Uhfile :File of mstr;
UserRecs :Userrec;
Place,a,b,c,d,e:Integer;
Flag :boolean;
Choice :Char;
Counter :Integer;
UserNum :Integer;
const ueditver='1.00';
procedure cursor (b:boolean);
var r:registers;
begin
with r do begin
ah:=$01;
if not b then begin
ch:=$20; cl:=$20
end else begin
ch:=5; cl:=7
end
end;
intr ($10,r)
end;
Procedure Show_Fields;
Begin
textcolor(15);
textbackground (1);
Gotoxy(2,2); Write('User Handle ');
Gotoxy(2,3); Write('User Note ');
Gotoxy(2,4); Write('Password ');
Gotoxy(2,5); Write('Main Level ');
Gotoxy(2,6); Write('File Level ');
Gotoxy(2,7); Write('Phone Number');
Gotoxy(2,8); Write('Time Today ');
Gotoxy(2,9); Write('File Points ');
Gotoxy(2,10);Write('Upload K ');
Gotoxy(2,11);Write('Download K ');
Gotoxy(2,12);Write('Uploads ');
Gotoxy(2,13);Write('Downloads ');
Gotoxy(2,14);Write('Gfile Level ');
Gotoxy(2,15);Write('Gfile UL''s ');
Gotoxy(2,16);Write('Gfile DL''s ');
Gotoxy(2,17);Write('Total Time ');
Gotoxy(2,18);Write('Macro #1 ');
Gotoxy(2,19);Write('Macro #2 ');
Gotoxy(2,20);Write('Macro #3 ');
End;
Procedure Place_Cursor;
Begin
With Userrecs do
Begin
textcolor (15); textbackground (7);
Case Place of
1:begin Gotoxy(2,2); Write('User Handle '); end;
2:begin Gotoxy(2,3); Write('User Note '); end;
3:begin Gotoxy(2,4); Write('Password '); end;
4:begin Gotoxy(2,5); Write('Main Level '); end;
5:begin Gotoxy(2,6); Write('File Level '); end;
6:begin Gotoxy(2,7); Write('Phone Number');end;
7:begin Gotoxy(2,8); Write('Time Today '); end;
8:begin Gotoxy(2,9); Write('File Points '); end;
9:begin Gotoxy(2,10);Write('Upload K '); end;
10:begin Gotoxy(2,11);Write('Download K '); end;
11:begin Gotoxy(2,12);Write('Uploads '); end;
12:begin Gotoxy(2,13);Write('Downloads '); end;
13:begin Gotoxy(2,14);Write('Gfile Level ');end;
14:begin Gotoxy(2,15);Write('Gfile UL''s ');end;
15:Begin Gotoxy(2,16);Write('Gfile DL''s ');end;
16:Begin Gotoxy(2,17);Write('Total Time '); end;
17:Begin Gotoxy(2,18);Write('Macro #1 '); end;
18:Begin Gotoxy(2,19);Write('Macro #2 '); end;
19:Begin Gotoxy(2,20);Write('Macro #3 '); end
End
End;
textbackground (1);
End;
Procedure Read_Cursor;
Begin
With Userrecs do
Begin
textcolor (11); textbackground (1);
Case Place of
1:begin Gotoxy(16,2);cursor(true);Read(Handle); place:=1;
{ if length(handle)<1 then place_cursor;
} End;
2:Begin Gotoxy(16,3);cursor(true);Read(Note); place:=2;
{ if length(note)<1 then place_cursor;
} End;
3:Begin Gotoxy(16,4);cursor(true);Read(password); place:=3;
{ if length(password)<1 then place_cursor;
} End;
4:Begin Gotoxy(16,5);cursor(true);Read(level); place:=4;
{ if level<1 then place_cursor;
} End;
5:Begin Gotoxy(16,6);cursor(true);Read(udlevel); place:=5;
{ if udlevel<1 then place_cursor;
} End;
6:Begin Gotoxy(16,7);cursor(true);Read(phonenum); place:=6;
{ if length(phonenum)<1 then place_cursor;
} End;
7:Begin Gotoxy(16,8);cursor(true);Read(timetoday); place:=7;
{ if timetoday<1 then place_cursor;
} End;
8:Begin Gotoxy(16,9);cursor(true);Read(udpoints); place:=8;
{ if udpoints<1 then place_cursor;
} End;
9:Begin Gotoxy(16,10);cursor(true);Read(upk); place:=9;
{ if upk<1 then place_cursor;
} End;
10:Begin Gotoxy(16,11);cursor(true);Read(Downk); place:=10;
{ if downk<1 then place_cursor;
} End;
11:Begin Gotoxy(16,12);cursor(true);Read(uploads); place:=11;
{ if uploads<1 then place_cursor;
} End;
12:Begin Gotoxy(16,13);cursor(true);Read(downloads); place:=12;
{ if downloads<1 then place_cursor;
} End;
13:Begin Gotoxy(16,14);cursor(true);Read(gflevel); place:=13;
{ if gflevel<1 then place_cursor;
} End;
14:Begin Gotoxy(16,15);cursor(true);Read(gfuploads); place:=14;
{ if gfuploads<1 then place_cursor;
} End;
15:Begin Gotoxy(16,16);cursor(true);Read(gfdownloads); place:=15;
{ if gfdownloads<1 then place_cursor;
} End;
16:Begin Gotoxy(16,17);cursor(true);Read(totaltime); place:=16;
{ if totaltime<1 then place_cursor;
} End;
17:Begin Gotoxy(16,18);cursor(true);Read(macro1); place:=17;
{ if length(macro1)<1 then place_cursor;
} End;
18:Begin Gotoxy(16,19);cursor(true);Read(macro2); place:=18;
{ if length(macro2)<1 then place_cursor;
} End;
19:Begin Gotoxy(16,20);cursor(true);Read(macro3); place:=19;
{ if length(macro3)<1 then place_cursor;
} End;
End
End;
cursor (false)
End;
Procedure List_Rec;
Begin
textcolor (15);
textbackground (1);
Seek(infile,Usernum);
Read(Infile,Userrecs);
Gotoxy(57,15);Write('User #: ',Usernum);
With UserRecs do
Begin
textcolor (11);
Gotoxy(16,2);Write(Handle);
Gotoxy(16,3);Write(Note);
Gotoxy(16,4);Write(password);
Gotoxy(16,5);Write(level);
Gotoxy(16,6);Write(udlevel);
Gotoxy(16,7);Write(phonenum);
Gotoxy(16,8);Write(timetoday);
Gotoxy(16,9);Write(udpoints);
Gotoxy(16,10);Write(upk);
Gotoxy(16,11);Write(Downk);
Gotoxy(16,12);Write(uploads);
Gotoxy(16,13);Write(downloads);
Gotoxy(16,14);Write(gflevel);
Gotoxy(16,15);Write(gfuploads);
Gotoxy(16,16);Write(gfdownloads);
Gotoxy(16,17);Write(totaltime:6:2);
Gotoxy(16,18);Write(macro1);
Gotoxy(16,19);Write(macro2);
Gotoxy(16,20);Write(macro3);
End
End;
Procedure Open_Rec;
Begin
Assign(Infile,bbsdatadir+'USERS.DAT');
Reset(Infile);
assign(Uhfile,bbsdatadir+'USERINDX.DAT');
Reset(Uhfile);
Counter:=0;
While not eof (Infile) do Begin
Read(Infile,userrecs);
Counter:=Counter+1
end;
UserNum:=1
end;
Procedure Write_Rec;
Begin
seek (infile,usernum);
write (infile,userrecs);
seek (uhfile,usernum);
write (uhfile,userrecs.handle);
End;
Procedure Format_Data_Area;
Begin
For A:=2 to 20 do begin
GotoXy(16,A);Write(' ');
End;
Gotoxy(69,15);Write(' ');
Gotoxy(57,17);Write(' ');
End;
Procedure Delete_Rec;
Begin
With Userrecs do
Begin
Nbu:=0;
Handle:='';
Note:='';
Password:='';
Level:=0;
Udlevel:=0;
Phonenum:='';
TimeToday:=0;
Udpoints:=0;
Upk:=0;
Downk:=0;
Uploads:=0;
Downloads:=0;
Write_Rec;
List_Rec;
Gflevel:=0;
Gfuploads:=0;
Gfdownloads:=0;
TotalTime:=0;
Macro1:='';
Macro2:='';
Macro3:=''
end;
Write_Rec;
Format_Data_Area;
List_Rec
End;
Procedure Add_Rec;
Begin
Usernum:=Counter;
Counter:=Counter+1;
textcolor (15); textbackground (1);
GotoXy(57,15);Write('User Number: ',Usernum);
With UserRecs do
Begin
nbu:=0;
textcolor (11);
Gotoxy(16,2);cursor(true);Read(Handle);
Gotoxy(16,3);cursor(true);Read(Note);
Gotoxy(16,4);cursor(true);Read(password);
Gotoxy(16,5);cursor(true);Read(level);
Gotoxy(16,6);cursor(true);Read(udlevel);
Gotoxy(16,7);cursor(true);Read(phonenum);
Gotoxy(16,8);cursor(true);Read(timetoday);
Gotoxy(16,9);cursor(true);Read(udpoints);
Gotoxy(16,10);cursor(true);Read(upk);
Gotoxy(16,11);cursor(true);Read(Downk);
Gotoxy(16,12);cursor(true);Read(uploads);
Gotoxy(16,13);cursor(true);Read(downloads);
Gotoxy(16,14);cursor(true);Read(gflevel);
Gotoxy(16,15);cursor(true);Read(gfuploads);
Gotoxy(16,16);cursor(true);Read(gfdownloads);
Gotoxy(16,17);cursor(true);Read(totaltime);
Gotoxy(16,18);cursor(true);Read(macro1);
Gotoxy(16,19);cursor(true);Read(macro2);
Gotoxy(16,20);cursor(true);Read(macro3);
End;
Seek(Infile,usernum);
Write(Infile,UserRecs);
cursor (false)
End;
var i:integer;
Begin
cursor (false);
readconfig;
ClrScr;
textbackground (1);
for i:=1 to 25 do begin
gotoxy (1,i); clreol; end;
A:=0;
B:=0;
C:=0;
d:=0;
Flag:=False;
textcolor (9);
Gotoxy(1,1);
Write('┌────────────┐');
For A:=2 to 20 do Begin
Gotoxy(1,a);
Write('│ │')
End;
Gotoxy(1,21);
Write('└────────────┘');
Gotoxy(15,1);
Write('┌───────────────────────────────────┐');
For A:=2 to 22 do Begin
Gotoxy(15,a);
Write('│ │')
End;
Gotoxy(15,23);
Write('└───────────────────────────────────┘');
Show_Fields;
Gotoxy(80,24);
textcolor (15);
Write(' [Q] Save/Quit [PageUp] Next User [PageDown] Previous User');
gotoxy(55,1);
Write('┌─────────────────┐');
For A:=2 to 10 do Begin
Gotoxy(55,a);
Write('│ │')
End;
Gotoxy(55,10);
Write('└─────────────────┘');
textcolor (11);
Gotoxy(57,2);
Write('FAQ User Editor');
Gotoxy(57,3);
Write(ueditver+' - by');
Gotoxy(57,4);
Write('The Firegod');
Gotoxy(57,5);
Write('(C)BaseTwo');
Gotoxy(57,6);
Write('Software 1991');
textcolor (9);
Gotoxy(55,11);
Write('┌──────────────────┐');
For A:=12 to 20 do Begin
Gotoxy(55,a);
Write('│ │')
End;
Gotoxy(55,20);
Write('└──────────────────┘');
textcolor (15);
Gotoxy(57,12);
Write('[A] Add User');
Gotoxy(57,13);
Write('[D] Delete User');
Gotoxy(57,19);
Write('[ESC] to Quit');
textcolor (9);
Open_Rec;
Format_Data_Area;
List_Rec;
Place:=1;
Place_Cursor;
While Flag=False do Begin
Choice:=upcase(Readkey);
Case Choice of
'A':Begin
Format_Data_Area;
Add_Rec
End;
'D':Begin
Gotoxy(57,17);
Write('Delete User?');
cursor(true);Choice:=upcase(Readkey);cursor (false);
If Choice='Y' then delete_rec else Begin
Gotoxy(57,17);
Write(' ')
End
End;
'Q':Begin
Write_Rec;
Close(Infile);
textcolor (7);
textbackground (0);
cursor (true);
ClrScr;
Halt
End;
#27:Begin
Write_Rec;
Close(Infile);
textcolor (7);
textbackground (0);
cursor (true);
ClrScr;
Halt
End;
#13:begin Read_Cursor; end;
#0:begin Place_Cursor;
Choice:=upcase(Readkey);
Case Choice of
#73:Begin
Write_Rec;
Usernum:=Usernum+1;
If Usernum>=counter then Usernum:=1;
Format_Data_Area;
List_Rec
End;
#81:Begin
Write_Rec;
Usernum:=Usernum-1;
If Usernum<1 then usernum:=Counter-1;
Format_Data_Area;
List_Rec
End;
#72:Begin
Place:=Place-1;
if Place<1 then place:=19;
Show_Fields;
Place_Cursor
End;
#80:Begin
Place:=Place+1;
If Place>19 then place:=1;
Show_Fields;
Place_Cursor
End;
End;
End;
End;
End;
textcolor (7);
textbackground (0);
cursor (true);
End.